<template>
  <a-card :bordered="false">

    <!-- 操作按钮区域 -->
    <!--    <div class="table-operator">
          <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
          <a-button type="primary" icon="download" @click="handleExportXls('京东到家计费明细')">导出</a-button>
          <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
            <a-button type="primary" icon="import">导入</a-button>
          </a-upload>
          <a-dropdown v-if="selectedRowKeys.length > 0">
            <a-menu slot="overlay">
              <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
            </a-menu>
            <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
          </a-dropdown>
        </div>-->

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
        style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">

        <!--        <span slot="action" slot-scope="text, record">
                  <a @click="handleEdit(record)">编辑</a>

                  <a-divider type="vertical" />
                  <a-dropdown>
                    <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                    <a-menu slot="overlay">
                      <a-menu-item>
                        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                          <a>删除</a>
                        </a-popconfirm>
                      </a-menu-item>
                    </a-menu>
                  </a-dropdown>
                </span>-->

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <!--    <omsJddjOrderBill-modal ref="modalForm" @ok="modalFormOk"></omsJddjOrderBill-modal>-->
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
/*import OmsJddjOrderBillModal from './modules/OmsJddjOrderBillModal'*/
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@/api/manage'

export default {
  name: 'OmsJddjOrderBillList',
  mixins: [JeecgListMixin],
  components: {
    // OmsJddjOrderBillModal
  },
  data() {
    return {
      description: '京东到家计费明细管理页面',
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '货款结算状态',
          align: 'center',
          dataIndex: 'googsSettlementStatus'
        },
        {
          title: '货款',
          align: 'center',
          dataIndex: 'goodsBill'
        },
        {
          title: '货款佣金',
          align: 'center',
          dataIndex: 'goodsCommissionBill'
        },
        {
          title: '运费',
          align: 'center',
          dataIndex: 'freightBill'
        },
        {
          title: '运费佣金',
          align: 'center',
          dataIndex: 'freightCommissionBill'
        },
        {
          title: '保底佣金补差',
          align: 'center',
          dataIndex: 'difflessCommision'
        },
        {
          title: '餐盒费',
          align: 'center',
          dataIndex: 'packageBill'
        },
        {
          title: '市场费结算状态',
          align: 'center',
          dataIndex: 'marketSettlementStatus'
        },
        {
          title: '市场费',
          align: 'center',
          dataIndex: 'marketBill'
        },
        {
          title: '营销服务费用',
          align: 'center',
          dataIndex: 'marketingServiceFee'
        },
        {
          title: '营销服务费用状态',
          align: 'center',
          dataIndex: 'marketingServiceFeeStatus'
        },
        {
          title: '对账单类型',
          align: 'center',
          dataIndex: 'billOrderType'
        }
      ],
      url: {
        list: '/oms/omsJddjOrder/listOmsJddjOrderBillByMainId',
      }
    }
  },
  computed: {

  },
  methods: {
    loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1
      }
      var params = this.getQueryParams()
      getAction(this.url.list, {
        jddjOrderId: params.mainId
        , pageNo: this.ipagination.current, pageSize: this.ipagination.pageSize
      }).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        } else {
          this.dataSource = null
        }
      })
    },
    getMain(mainId) {
      this.queryParam.mainId = mainId
      this.loadData(1)
    },
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>